package com.demo2do.fms.admin.service.authority.impl;

import java.util.List;

import org.springframework.stereotype.Service;

import com.demo2do.core.persistence.annotation.Dao;
import com.demo2do.fms.admin.dao.authority.UserDao;
import com.demo2do.fms.admin.dao.authority.VendorDao;
import com.demo2do.fms.admin.dao.supplier.OrganizationDao;
import com.demo2do.fms.admin.service.DataServiceImpl;
import com.demo2do.fms.admin.service.authority.OrganizationService;
import com.demo2do.fms.entity.authority.Organization;
import com.demo2do.fms.entity.authority.User;
import com.demo2do.fms.entity.vendor.Vendor;

/**
 * 
 * @author Ysy
 *
 */
@Service("organizationService")
public class OrganizationServiceImpl extends DataServiceImpl<Organization> implements OrganizationService {
    
    @Dao
    private OrganizationDao organizationDao;
    
    @Dao VendorDao vendorDao;
    
    @Dao
    private UserDao userDao;
    
    /* (non-Javadoc)
     * @see com.demo2do.fms.admin.service.authority.OrganizationService#listUserOrganization(com.demo2do.fms.entity.authority.User)
     */
    public List<Long> listUserOrganization(User user) {
        return userDao.listUserOrgnization(user);
    }
    
    /* (non-Javadoc)
     * @see com.demo2do.fms.admin.service.authority.OrganizationService#listSystemOrganization()
     */
    public List<Organization> listSystemOrganization() {
        return organizationDao.list(true);
    }

    /*
     * (non-Javadoc)
     * @see com.demo2do.fms.admin.service.authority.OrganizationService#load(java.lang.String)
     */
    public Vendor load(String id) {
       
        return vendorDao.load(id);
    }

}
